package com.bnuboy.activity;
import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.map.MapController;
import com.baidu.mapapi.map.MapView;
import com.baidu.platform.comapi.basestruct.GeoPoint;

import android.os.Bundle;  
import android.support.v4.app.Fragment;  
import android.view.LayoutInflater;  
import android.view.View;  
import android.view.ViewGroup;  
import android.widget.TextView;  
  
public class FragmentBaiduMap extends Fragment {  

	static MapView mMapView = null;
    private MapController mMapController = null;

	
    @Override  
    public View onCreateView(LayoutInflater inflater, ViewGroup container,  
            Bundle savedInstanceState) {  
        View v = inflater.inflate(R.layout.fragment_baidumap, container, false);

        mMapView = (MapView) v.findViewById(R.id.bmapsView);
        mMapController = mMapView.getController();
        mMapView.getController().setZoom(14);
        mMapView.getController().enableClick(true);
        mMapView.setBuiltInZoomControls(true);

        mMapView.refresh();
        return v;
    }  
  
    @Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
    	super.onCreate(savedInstanceState);
    	DemoApplication app = (DemoApplication) getActivity().getApplication();
        if (app.mBMapManager == null) {
            app.mBMapManager = new BMapManager(getActivity());
            app.mBMapManager.init(DemoApplication.strKey, new DemoApplication.MyGeneralListener());
        }
		
	}

	@Override  
    public void onActivityCreated(Bundle savedInstanceState) {  
        super.onActivityCreated(savedInstanceState);  
  
    }  
  
    @Override  
    public void onPause() {  
        super.onPause();  
    }  
  
}  